from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

'''
本文件定义了数据的连接参数
'''
#SQLALCHEMY_DATABASE_URL = "mysql+pymysql://root:yongs81@47.113.124.50:3306/demo"
SQLALCHEMY_DATABASE_URL = "mysql+pymysql://root:yongs81@106.52.146.218:3306/demo"

# 创建引擎
engine = create_engine(SQLALCHEMY_DATABASE_URL, echo=True, encoding='utf-8', convert_unicode=True)

# 创建 session
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

# 创建模块
Base = declarative_base()
